package com.soup.lab.third.token;

import java.util.Objects;

/**
 * token相关配置
 */
public class TokenConfig {
    /**
     * token分组
     * token所属厂商等标志
     */
    private final String group;
    /**
     * 获取token鉴权配置
     */
    private final TokenAuth tokenAuth;
    /**
     * token属性配置
     */
    private final TokenProperty tokenProperty;

    public TokenConfig(String group, TokenAuth tokenAuth) {
        this(group, tokenAuth, TokenProperty.getDefault());
    }

    public TokenConfig(String group, TokenAuth tokenAuth, TokenProperty tokenProperty) {
        this.group = Objects.requireNonNull(group);
        this.tokenAuth = Objects.requireNonNull(tokenAuth);
        this.tokenProperty = Objects.requireNonNull(tokenProperty);
    }

    public String getGroup() {
        return group;
    }

    public TokenAuth getTokenAuth() {
        return tokenAuth;
    }

    public TokenProperty getTokenProperty() {
        return tokenProperty;
    }

    @Override
    public String toString() {
        return "TokenConfig{" +
                "group='" + group + '\'' +
                ", tokenAuth=" + tokenAuth +
                ", tokenProperty=" + tokenProperty +
                '}';
    }
}
